package com.by.mapper;

import com.by.bean.pucharse.PurchaseDetail;
import com.by.common.crud.IMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PurchaseDetailMapper extends IMapper<PurchaseDetail> {
    /**
     * 批量保存采购明细
     * @param pid 采购单id
     * @param purchaseDetailList  采购明细
     * @return
     */
    int batchSave(@Param("pid") int pid,@Param("purchaseDetailList") List<PurchaseDetail> purchaseDetailList);

    /**
     * 根据采购单id 删除采购明细
     * @param id
     * @return
     */
    int deleteByPurchaseId(int id);

    /**
     * 根据采购单id 查找明细
     * @param purchaseId
     * @return
     */
    List<PurchaseDetail> queryByPurchaseId(int purchaseId);
}
